package com.yunhe.policyfulfillment.policyful.service;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.policyfulfillment.policyful.domain.PolicyCommonQuestion;
import com.yunhe.policyfulfillment.policyful.model.PolicyCommonQuestionVo;
import com.yunhe.policyfulfillment.policyful.model.PolicyCommonQuestionVo2;

import java.util.List;

/**
 * @author zhengbo
 * @date 2021/10/12 18:01
 */
public interface PolicyCommonQuestionService {

    /**
     * 新增
     */
    void createPolicyCommonQuestion (PolicyCommonQuestion policyCommonQuestion) throws ArgumentErrorException;

    /**
     * 批量删除
     */
    void patchDeletePolicyCommonQuestion(List<Long> ids);

    /**
     * 删除
     */
    void deletePolicyCommonQuestion(int id);

    /**
     * 更新
     */
    void updatePolicyCommonQuestion(PolicyCommonQuestion policyCommonQuestion);

    /**
     * 根据主键 id 查询
     */
    PolicyCommonQuestion findPolicyCommonQuestionById(int id);

    /**
     * 根据条件查询列表
     * @param vo
     * @return
     */
    PageResult<PolicyCommonQuestion> findPolicyCommonQuestionListByCondition(PolicyCommonQuestionVo vo);

    /**
     * 禁用/正常
     * @param vo
     * @throws ArgumentErrorException
     */
    void disableOrRelease(PolicyCommonQuestionVo2 vo) throws ArgumentErrorException;

    /**
     * 更新一小时内的需要发布的问题
     */
    void publishTimedCommonQuestion();

    /**
     * 根据id查询常见问题，并增加一次浏览次数
     * @param id
     * @return
     */
    PolicyCommonQuestion findPolicyCommonQuestionByIdForIndex(Long id);
}
